/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    line-height: 1.6;
    background-color: #f9f9f9;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
}

/* 导航栏 */
.navbar {
    background: #333;
    color: white;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.5rem;
}

.navbar nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar nav ul li {
    position: relative;
}

.navbar nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.3s ease;
    position: relative;
}

/* 悬停文字颜色变化 */
.navbar nav ul li a:hover {
    color: #4CAF50;
    /* 改变链接颜色 */
}

/* 关于我们样式 */
.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 20px;
    align-items: center;
}

.about-image {
    flex: 1;
    min-width: 250px;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-text h4 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #333;
}

.about-text p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.skills {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skills li {
    background: #4CAF50;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.skills li:hover {
    background: #45a049;
}

/* 服务部分样式 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.service-item {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.service-item .icon {
    font-size: 2rem;
    color: #4CAF50;
    margin-bottom: 10px;
}

.service-item h4 {
    margin-bottom: 10px;
    color: #333;
}

.service-item p {
    font-size: 0.9rem;
    color: #777;
}

/* 添加底部线条动画 */
.navbar nav ul li a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.navbar nav ul li a:hover::after {
    width: 100%;
}

.hero {
    background: #4CAF50;
    color: white;
    padding: 100px 0;
    text-align: center;
}

/* 普通章节 */
/* 作品集样式 */
.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    position: relative;
}

.portfolio-grid .item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: calc(33% - 15px);
    /* 三列布局 */
    margin-top: 20px;
    z-index: 1;
}

.portfolio-grid .item:nth-child(even) {
    transform: translateY(-15px);
}

.portfolio-grid .item:nth-child(odd) {
    transform: translateY(15px);
}

.portfolio-grid .item:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.portfolio-grid .item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.portfolio-grid .item:hover img {
    opacity: 0.9;
}

/* 表单样式 */
.contact-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: auto;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    margin-bottom: 20px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.contact-form button {
    background: linear-gradient(to right, #4CAF50, #81C784);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.contact-form button:hover {
    background: linear-gradient(to right, #81C784, #4CAF50);
    transform: translateY(-2px);
}

/* 底部 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
}